import config from "@/config"
import http from "@/utils/request"



export default {
	// 	token: {
	// 		url: `${config.API_URL}/token`,
	// 		name: "登录获取TOKEN",
	// 		post: async function (data = {}) {
	// 			return await http.post(this.url, data)
	// 		}
	// 	}
	// }

	token: {
		url: `${config.API_URL}/auth/login`,
		name: "登录获取TOKEN",
		post: function (data = {}) {
			return new Promise((resolve, reject) => {
				http.postParam(this.url, data).then((response) => {
					resolve(response)
				}).catch((error) => {
					resolve(error.data)
				})
			})
		}
	},
	refreshToken: {
		url: `${config.API_URL}/auth/refreshToken`,
		name: "刷新token",
		post: function (data = {}) {
			return new Promise((resolve, reject) => {
				http.postParam(this.url, data).then((response) => {
					resolve(response)
				}).catch((error) => {
					resolve(error.data)
				})
			})
		}
	},

	system: {
		getSystemData: {
			url: `${config.API_URL}/operationAuto/list`,
			name: "获取系统配置数据",
			get: function (data = {}) {
				return new Promise((resolve, reject) => {
					http.get(this.url, data).then((response) => {
						resolve(response)
					}).catch((error) => {
						resolve(error.data)
					})
				})
			}
		},
	}


}
